<?php

require_once 'init.php';
require_once 'cf/shop.inc';

$catId = $par->get('id');

$cat = new Group($catId);
$groups = Groups::toHierarchyTree($catId,false,true);
$products = array();
foreach ($groups as $group) {
	$productsInGroup = new Products($group['id']);
	$products[$group['id']] = $productsInGroup->getList();
}
$smarty->assign('topGroups', ($cat->code()=='dlya-naruzhnogo-montazha' || $cat->code()=='dlya-vnutrennego-montazha') ? new ChildGroups(Group::rootId) : false);
$smarty->assign('cat',$cat);
$smarty->assign('groups',$groups);
$smarty->assign('products', $products);

show(
	'catalog_main',
	$cat->name(),
	Groups::getPath($catId),
	$cat->pageTitle(),
	$cat->pageKeywords(),
	$cat->pageDescr()
);

?>